/* GUI CONVERTED from sqqoiq.p (converter v1.75) Sat Aug 12 17:34:49 2000 */
/* sqqoiq.p - QUOTE INQUIRY                                             */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert sqqoiq.p (converter v1.00) Fri Oct 10 13:58:08 1997 */
/* web tag in sqqoiq.p (converter v1.00) Mon Oct 06 14:18:50 1997 */
/*F0PN*/ /*K1JY*/ /*                                                    */
/*V8:ConvertMode=Report                                        */
/* REVISION: 4.0      LAST MODIFIED: 12/06/88   BY: jms *A548*          */
/* REVISION: 5.0      LAST EDIT    : 05/03/89   BY: WUG *B098*          */
/* Revision: 7.3      Last edit    : 11/19/92   By: jcd *G339*          */
/* REVISION: 7.4      LAST MODIFIED: 11/19/96   BY: *H0PJ* Suresh Nayak */
/* REVISION: 8.6      LAST MODIFIED: 02/26/98   BY: *K1JY* Beena Mol    */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KN* myb              */

/* DISPLAY TITLE */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "b+ "}

define variable cust like so_cust.
define variable nbr like qo_nbr.
define variable part like pt_part.
define variable desc1 like pt_desc1.

part = global_part.

/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
part desc1 nbr cust
with frame a no-underline width 80 attr-space THREE-D /*GUI*/.

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME

/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/*K1JY*/ {wbrp01.i}

repeat:
/*K1JY*/ if c-application-mode <> 'web' then
   update part nbr cust with frame a editing:

      if frame-field = "part" then do:
     /* FIND NEXT/PREVIOUS RECORD */
     {mfnp.i qod_det part qod_part part qod_part qod_part}

     if recno <> ? then do:
        part = qod_part.
        desc1 = qod_desc.
        if desc1 = "" then do:
           find pt_mstr where pt_part = qod_part no-lock no-error.
           if available pt_mstr then desc1 = pt_desc1.
        end.
        display part desc1 with frame a.
        recno = ?.
     end.
      end.

      else do:
     status input.
     readkey.
     apply lastkey.
      end.

   end.

/*K1JY*/ {wbrp06.i &command = update &fields = "  part nbr cust" &frm = "a"}

/*K1JY*/ if (c-application-mode <> 'web') or
/*K1JY*/ (c-application-mode = 'web' and
/*K1JY*/ (c-web-request begins 'data')) then do:

   hide frame b.
   hide frame c.
   hide frame d.
   hide frame e.

   find pt_mstr where pt_part = part no-lock no-error.
   if available pt_mstr then desc1 = pt_desc1.
   if available pt_mstr then display desc1 with frame a.
   else display "" @ desc1 with frame a.

/*K1JY*/ end.

   /* SELECT PRINTER */
   {mfselprt.i "terminal" 80}

    {hksimsg.i """" """"}       /*fdn*/

   if part <> "" then for each qod_det where qod_part = part
      no-lock with frame b width 80 no-attr-space:
                /* SET EXTERNAL LABELS */
                setFrameLabels(frame b:handle).
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         /*G339*/
      find qo_mstr where qo_nbr = qod_nbr AND LOOKUP(qo_site, global_user_site) > 0 no-lock.        /*fdn*/
      if (qo_nbr = nbr or nbr = "") and (qo_cust = cust or cust = "") then do:
     display  qo_nbr qo_cust qod_line qod_qty_quot format "->>>,>>9.99"
     qod_rel_chg format "->>>,>>9.99" qod_um qo_ord_date qo_exp_date WITH STREAM-IO /*GUI*/ .
      end.
   end.

   else if nbr <> "" then
      loopc: for each qo_mstr where qo_nbr  = nbr and
                    (qo_cust = cust or cust = "")  AND LOOKUP(qo_site, global_user_site) > 0        /*fdn*/
                    no-lock with frame c width 80 no-attr-space:
                /* SET EXTERNAL LABELS */
                setFrameLabels(frame c:handle).
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         /*G339*/
      for each qod_det where qod_nbr = qo_nbr
     no-lock on endkey undo, leave loopc with frame c:
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         /*G339*/
     display  qo_cust qod_line qod_part qod_qty_quot format "->>>,>>9.99"
     qod_rel_chg format "->>>,>>9.99" qod_um qo_ord_date qo_exp_date WITH STREAM-IO /*GUI*/ .
     down 1.
      end.
   end.

   else if cust <> "" then
      loopd: for each qo_mstr where (qo_cust = cust)  AND LOOKUP(qo_site, global_user_site) > 0  no-lock        /*fdn*/
                  with frame d width 80 no-attr-space:
                /* SET EXTERNAL LABELS */
                setFrameLabels(frame d:handle).
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         /*G339*/
      for each qod_det where qod_nbr = qo_nbr no-lock by qod_nbr by qod_line
                 on endkey undo, leave loopd with frame d:
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         /*G339*/
     display qo_nbr qod_line qod_part qod_qty_quot format "->>>,>>9.99"
     qod_rel_chg format "->>>,>>9.99" qod_um qo_ord_date qo_exp_date WITH STREAM-IO /*GUI*/ .
     down 1.
      end.
   end.

/*H0PJ**  else for each qod_det no-lock by qod_part                    */
/*H0PJ*/  else for each qod_det no-lock
/*H0PJ*/                 where qod_nbr >= "" and qod_line >= 0
/*H0PJ*/                 by qod_part
             with frame e width 80 no-attr-space:
                /* SET EXTERNAL LABELS */
                setFrameLabels(frame e:handle).
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         /*G339*/
      find qo_mstr where qo_nbr = qod_nbr  AND LOOKUP(qo_site, global_user_site) > 0  no-lock.          /*fdn*/
      display qo_nbr qo_cust qod_line qod_part qod_qty_quot format "->>>,>>9.99"
          qod_um qo_ord_date qo_exp_date WITH STREAM-IO /*GUI*/ .
   end.

   {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

   {mfmsg.i 8 1}

end.
global_part = part.

/*K1JY*/ {wbrp04.i &frame-spec = a}
